/*
 * @Author: your name
 * @Date: 2021-07-13 14:59:33
 * @LastEditTime: 2021-07-13 16:48:54
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \usp-osm-frondend\src\api\catalog.js
 */
import { service } from '@/utils/request'

const api = {
  catalogList: '/admin/mdse/catalog/getChildren/',
  catalogDetail: '/admin/mdse/catalog/get/',
  catalogUpdate: '/admin/mdse/catalog/saveOrUpdate',
  catalogDelete: '/admin/mdse/catalog/delete/'
}

export function getList (parentId) {
  return service({
    url: api.catalogList + parentId,
    method: 'get'
  })
}

export function getDetail (id) {
  return service({
    url: api.catalogDetail + id,
    method: 'get'
  })
}

export function catalogUpdate (data) {
  return service({
    url: api.catalogUpdate,
    method: 'post',
    data
  })
}

export function catalogDelete (id) {
  return service({
    url: api.catalogDelete + id,
    method: 'get'
  })
}
